﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Myinfo : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Page.Title = "我的信息";
        
        scjrm.WebServiceGZ Web = new scjrm.WebServiceGZ();
        if (Session["UID"] != null)
        {
            string YGBH = Session["ygbh"].ToString();
            DataSet dsinfouser = Web.GetInfoUserName("shensoft", YGBH);
            if (dsinfouser != null)
            {
                if (!IsPostBack)
                {
                    //显示记录集的记录
                    DropDownList2.DataSource = dsinfouser.Tables[0].DefaultView;//指定DropDownList使用的表里的那些字段
                    DropDownList2.DataTextField = "xingming"; //dropdownlist的Text的字段
                    DropDownList2.DataValueField = "ygbh";//dropdownlist的Value的字段
                    DropDownList2.DataBind();
                    DropDownList2.SelectedValue = YGBH;
                }
            }
            else
            {
                this.Response.Write("加载数据错误!");
            }

            string GetInfoNote = Web.GetInfoUser("shensoft", YGBH);
            string[] InfoNoteArray = GetInfoNote.Split('|');

            IDinfo.Text = "<li>【部门/岗位：" + InfoNoteArray[9].ToString() + "/" + InfoNoteArray[10].ToString() + "】</li>" +
                  "<li>【身份证号码：" + InfoNoteArray[0].ToString() + "】</li>" +
              "<li>【性别：" + InfoNoteArray[1].ToString() + "】【出生：" + InfoNoteArray[2].ToString() + "】</li>" +
              "<li>【入司：" + InfoNoteArray[3].ToString() + "】【状态：" + InfoNoteArray[4].ToString() + "】</li>" +
              "<li>【开户银行：" + InfoNoteArray[5].ToString() + "】</li>" +
              "<li>【银行账号：" + InfoNoteArray[6].ToString() + "】</li>" +
              "<li>【电话：<a href=\"tel:" + InfoNoteArray[7].ToString() + "\">" + InfoNoteArray[7].ToString() + "</a>】【离职时间：" + InfoNoteArray[8].ToString() + "】</li>";
            //string Photo = InfoNoteArray[11].ToString();
            //Photos.ImageUrl = Photo;
        }
        else
        {
            Session.Abandon();
            //清空
            Session.Clear();
            Response.Redirect("Login.aspx");
        }
    }

    protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e)
    {

    }
    protected void submit_Click(object sender, EventArgs e)
    {
        string YGBH = DropDownList2.SelectedItem.Value;

        scjrm.WebServiceGZ Web = new scjrm.WebServiceGZ();

        string GetInfoNote = Web.GetInfoUser("shensoft", YGBH);
        string[] InfoNoteArray = GetInfoNote.Split('|');

        IDinfo.Text = "<li>【部门/岗位：" + InfoNoteArray[9].ToString() + "/" + InfoNoteArray[10].ToString() + "】</li>" +
              "<li>【身份证号码：" + InfoNoteArray[0].ToString() + "】</li>" +
          "<li>【性别：" + InfoNoteArray[1].ToString() + "】【出生：" + InfoNoteArray[2].ToString() + "】</li>" +
          "<li>【入司：" + InfoNoteArray[3].ToString() + "】【状态：" + InfoNoteArray[4].ToString() + "】</li>" +
          "<li>【开户银行：" + InfoNoteArray[5].ToString() + "】</li>" +
          "<li>【银行账号：" + InfoNoteArray[6].ToString() + "】</li>" +
          "<li>【电话：" + InfoNoteArray[7].ToString() + "】【离职时间：" + InfoNoteArray[8].ToString() + "】</li>";
        //string Photo = InfoNoteArray[11].ToString();
        //Photos.ImageUrl = Photo;
    }
}
